package com.bwie.service.impl;

import com.bwie.mapper.OwnerMapper;
import com.bwie.pojo.Owner;
import com.bwie.pojo.Result;
import com.bwie.service.OwnerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OwnerServiceImpl implements OwnerService {

    @Autowired
    private OwnerMapper ownerMapper ;

    /**
     * 跳添加业主页面
     */
    @Override
    public Owner findById(Integer ownerId) {
        Owner owner = ownerMapper.findById(ownerId);
        return owner;
    }

    /**
     * 添加业主页面
     * @param owner
     * @return
     */
    @Override
    public Result add(Owner owner) {
        owner.setIsDel(0);
        ownerMapper.add(owner);
        return Result.success("添加成功");
    }
}
